package cate.game.role.show.bubble;


import cate.common.table.d.GDBlog;
import cate.game.role.show.ShowBagTab;
import cate.game.role.show.msg.ModifyTitleResp;
import easy.java.dev.note.NoteClass;

import java.util.List;


@NoteClass("气泡框")
public class RoleBubbleBox extends ShowBagTab<BubbleBox> {

    @Override
    public byte getType() {
        return GDBlog.DecorateType.BUBBLE_BOX;
    }

    @Override
    protected BubbleBox createItem(int tid, long validTime) {
        return new BubbleBox(tid,validTime);
    }

    @Override
    public void onInvalid(List<Integer> expireTids) {
        for (Integer expireTid : expireTids) {
            if (role.getBase().bubbleBox.tid == expireTid) {
                role.getBase().bubbleBox.tid = 0;
                role.sendNow(new ModifyTitleResp(role));
                return;
            }
        }
    }
}
